using Microsoft.Practices.CompositeWeb;
using Microsoft.Practices.ObjectBuilder;

namespace PageFlowQuickstart.Modules.Customers.Views
{
    public class SummaryViewPresenter : Presenter<ISummaryView>
    {
        private CustomersController _controller;
        
        public SummaryViewPresenter([CreateNew] CustomersController controller)
        {
            _controller = controller;
        }

        public override void OnViewInitialized()
        {
            View.Customer = _controller.CurrentCustomer;
            _controller.FinishCustomerApproval();
        }

        public void OnApproveAnotherCustomer()
        {
            _controller.StartCustomerApproval();
        }
    }
}
